package com.itheima.tanhua.web;

import com.itheima.autoconfig.template.HuanXinTemplate;
import com.itheima.tanhua.api.db.UserServiceApi;
import com.itheima.tanhua.service.HuanXinService;
import com.itheima.tanhuan.pojo.db.User;
import com.itheima.tanhuan.pojo.db.UserInfo;
import com.itheima.tanhuan.vo.db.HuanXinUserVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("huanxin")
public class HuanxinController {
   @Autowired
   HuanXinService huanXinService;


    @GetMapping("user")
    public ResponseEntity user(){
        return ResponseEntity.ok(huanXinService.huanxinUser());
    }

    //需要展示出用户的基本信息，这是需要通过环信用户id查询用户。
    @GetMapping("userinfo")
    public ResponseEntity userInfo(String huanxinId){
        UserInfo userInfo=huanXinService.userInfo(huanxinId);
        return ResponseEntity.ok(userInfo);
    }

}
